package com.gl.ruanzhu.service.impl;

import com.gl.ruanzhu.dto.TaskDto;
import com.gl.ruanzhu.dto.TaskIndustryDto;
import com.gl.ruanzhu.mapper.PersonalMapper;
import com.gl.ruanzhu.mapper.TaskIndustryMapper;
import com.gl.ruanzhu.service.PersonalDalService;
import com.gl.ruanzhu.service.TaskIndustryDalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
//@SuppressWarnings("all")
public class TaskIndustryDalServiceImpl implements TaskIndustryDalService {

    @Autowired
    TaskIndustryMapper taskIndustryMapper;

    @Override
    public List<TaskIndustryDto>  quaryList() {
        List<TaskIndustryDto> taskIndustryDtos = taskIndustryMapper.quaryIndustry();
        if(taskIndustryDtos.size()>0) {
            for (TaskIndustryDto taskIndustryDto : taskIndustryDtos) {
                List<TaskIndustryDto> taskIndustryDtos1 = taskIndustryMapper.quaryChildIndustry(taskIndustryDto.getId() + "");
                taskIndustryDto.setChildren(taskIndustryDtos1);
            }
        }
        return taskIndustryDtos;
    }



    /*@Override
    public int uploadFileTest(MultipartFile zipFile) {
        String targetFilePath = "D:\\test\\uploadTest";
        String fileName = UUID.randomUUID().toString().replace("-", "");
        File targetFile = new File(targetFilePath + File.separator + fileName);

        FileOutputStream fileOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(targetFile);
            IOUtils.copy(zipFile.getInputStream(), fileOutputStream);
        } catch (IOException e) {
            return 0;
        } finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                return 1;
            }
        saveTask()
        }
        return 0;
    }*/



}
